package nix.struts.param;

import java.util.Date;

import com.opensymphony.xwork2.ActionSupport;

public class Demo1Action extends ActionSupport {
	// Action每次请求都会创建新的实例，是线程安全的
	public Demo1Action() {
		super();
		System.out.println("new()...");
	}

	// 使用属性接收参数
	private String name;
	// 属性接收参数支持八大数据类型自动转换
	private Integer age;
	// 支持yyyy-MM-dd格式的日期类型自动转换
	private Date birthday;

	@Override
	public String execute() throws Exception {

		System.out.println("name: " + name);
		System.out.println("age: " + age);
		System.out.println("birthday: " + birthday);
		return SUCCESS;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
